package com.example.emptytest;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.WindowManager;

import java.util.Timer;
import java.util.TimerTask;

public class WelcomeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

        startHomepage();
    }

    private void startHomepage() {
        TimerTask delayTask = new TimerTask(){

            @Override
            public void run() {
                Intent mIntent = getIntent();
                String STNum=(String) mIntent.getSerializableExtra("STNum");
                Intent HomepageIntent = new Intent(WelcomeActivity.this,Homepage.class);
                HomepageIntent.putExtra("STNum",STNum);
                startActivity(HomepageIntent);
                WelcomeActivity.this.finish();
            }
        };
        Timer timer = new Timer();
        timer.schedule(delayTask,2000);
    }
}